#!/usr/bin/python3
# coding=utf-8
#
# Copyright (C) 2023-2024. Huawei Technologies Co., Ltd. All rights reserved.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# ===============================================================================

import numpy as np
import torch

def gen_golden_data_simple():

    # 设置输入类型
    # import tensorflow as tf
    # dtype = tf.bfloat16.as_numpy_dtype
    dtype = np.float16
    # dtype = np.float32
    # dtype = np.int8
    # dtype = np.int16
    # dtype = np.int32
    
    # alpha=1.0
    # 生成输入
    input_x = np.random.uniform(-3, 3, [7,370,35]).astype(dtype)
    # input_y = np.random.uniform(-10, 10, [7,370,35]).astype(dtype)

    # 生成输出
    celu = torch.nn.CELU(alpha=1.0)
    golden = celu(torch.tensor(input_x)).numpy().astype(dtype)

    input_x.tofile("./input/input_x.bin")
    # input_y.tofile("./input/input_y.bin")
    golden.tofile("./output/golden.bin")


if __name__ == "__main__":
    gen_golden_data_simple()


